package cn.ronghui.project.types.enums;

import lombok.Getter;

@Getter
public enum AdminRoleEnumVO {
    ADMIN("admin","管理员"),
    SUPER_ADMIN("super_admin","超级管理员"),
    CHIEF("chief","楼长"),
    ;
    private String code;
    private String info;

    AdminRoleEnumVO(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public static AdminRoleEnumVO getAdminRoleEnum(String value){
        switch (value){
            case "管理员":
                return ADMIN;
            case "超级管理员":
                return SUPER_ADMIN;
            case "楼长":
                return CHIEF;
            default:
                throw new RuntimeException("参数错误");

        }
    }
}
